program Parallel;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  fin: textfile;
  x, y, x1, x2, y1, y2: array of integer;
  a1, b1, c1, a2, b2, c2, i, j, n, k, q, cnt, x0, y0: integer;

label
  found;

begin
  assignfile(fin, 'input.txt');
  readln(fin, n);
  for i:=1 to n do
  begin
    read(fin, x1[i]);
    read(fin, y1[i]);
    read(fin, x2[i]);
    read(fin, y2[i]);
    readln;
  end;

  cnt:=0;

  for i:=1 to n do
  begin
    a1:=y1[i]-y2[i];
    b1:=x2[i]-x1[i];
    c1:=x1[i]*y2[i]-x2[i]*y1[i];

    for j:=i+1 to n do
      begin
        a2:=y1[j]-y2[j];
        b2:=x2[j]-x1[j];
        c2:=x1[j]*y2[j]-x2[j]*y1[j];

        if (a1<>a2) or (b1<>b2) or (c1<>c2) then
          begin
            y0:=(c1*a2/a1-c2)/(b2-b1*a2/a1);
            x0:=((b1/a1)*((c1*a2/a1-c2)/(b2-b1*a2/a1)))-c1/a1;

            if cnt = 0 then
            begin
              cnt:=cnt+1;
              x[1]:=x0;
              y[1]:=y0;
            end
            else
            begin
               for k:=1 to cnt do
                 begin
                 if (x[k]=x0) and (y[k]=y0) then
                   GoTo found;
                 end;
                 cnt:=cnt+1;
                 x[cnt]:= x0;
                 y[cnt]:= y0;

                 found:
                 ;

            end;
          end;
      end;
  end;





end.
